package com.fu.core.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Date;
import java.sql.Timestamp;

/**
 * @author 付龙江
 * @date 2022/1/28 13:14
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "tb_goods")
public class Goods implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "goodsId")
    private Integer goodsId;
    @Column(name = "goodsName")
    private String goodsName;
    @Column(name = "goodsKeyWord")
    private String goodsKeyWord;
    @Column(name = "typeId")
    private Integer typeId;
    @Column(name = "goodsMainImg")
    private String goodsMainImg;
    @Column(name = "goodsStartShelf")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Timestamp goodsStartShelf;
    @Column(name = "goodsStatus")
    private Integer goodsStatus;
    @Column(name = "goodsDetails")
    private String goodsDetails;
    @Column(name = "goodsDetailsImg")
    private String goodsDetailsImg;
    @Column(name = "goodsStartPrice")
    private Double goodsStartPrice;
    @Column(name = "goodsUnit")
    private String goodsUnit;
    @Column(name = "goodsSeckill")
    private Integer goodsSeckill;

    /**
     * 往数据库中存储年月日
     */
    @Column(name = "goodsSeckillDay")
    private Date goodsSeckillDay;

    /**
     * 时分秒  09:00:00  12:00:00  15:00:00  18:00:00
     */
    @Column(name = "goodsSeckillDayDetails")
    private String goodsSeckillDayDetails;
    /**
     * 秒杀价格
     */
    @Column(name = "seckillPrice")
    private Double seckillPrice;

    /**
     * 秒杀数量
     */
    @Column(name = "seckillNum")
    private Integer seckillNum;

}
